<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .father{
            width: 500px;
            height: 500px;
            background-color: pink;
            /* 解决margin-top塌陷三种方式
            1.给父元素设置border
            2.设置父元素 overflow: hidden;
            3.使用padding代替margin
            */
            /* border: 1px solid transparent; */
            /* overflow: hidden; */
            /* padding: 50px; */

        }

        .son{
            width: 200px;
            height: 200px;
            background-color: green;
            margin-top: 50px;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son"></div>
    </div>
</body>
</html>